home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 3
/
The Arsenal Files 3.iso
/
gen_prog
/
appdemo.exe
/
DEMOBIRT.APP
< prev
next >
Wrap
Text File
|
1994-11-07
|
2KB
|
44 lines
// This simple program calculates which day of the week you were born in.
// The following lines tells the compiler which library files to use.
#include "STRING.APP"
#include "MAINLIB.APP" // MAINLIB.APP must always be the last #include
int Main()
{
// All items after double slashes // are comments
// Declare the three variables used
int Day;
int Month;
int Year;
// In C++ and A++ "cout" is the standard output device (ie. the Screen)
// The "<<" is used to show in which way the information flows
// In C++ and A++ the "\n" means "New Line"
cout << "Hello, Please enter the following about your birthday\n\n";
cout << "Month Born (1 - 12) = ";
// In C++ and A++ cin is the Standard input device (ie. the Keyboard)
cin >> Month;
cout << "Day of Month Born (1 - 31) = ";
cin >> Day;
cout << "Year Born (1900 - 2000) = ";
cin >> Year;
// In the next line a Function is called which returns the Day of the Week
// when it is given the Day, Month and Year.
// DX is a register in the CPU.
DX = DayOfWeek(Day, Month, Year);
cout << "You were born on a ";
// In A++, like C++, the "==" is used to test if "Equal To"
if(DX == 0) cout << "Sunday";
else if(DX == 1) cout << "Monday";
else if(DX == 2) cout << "Tuesday";
else if(DX == 3) cout << "Wednesday";
else if(DX == 4) cout << "Thursday";
else if(DX == 5) cout << "Friday";
else if(DX == 6) cout << "Saturday";
cout << "\n\n"; // Move down by two lines
return 0; // Return to DOS with Error 0
}